<?php
declare (strict_types=1);

namespace app\admin\model\shop\goods;

use think\Model;
use think\model\concern\SoftDelete;
use think\model\relation\BelongsTo;

/**
 * @mixin Model
 */
class GoodsSku extends Model
{
    use SoftDelete;

    protected $defaultSoftDelete = 0;

    // 表名
    protected $name = 'shop_goods_sku';

    protected $autoWriteTimestamp = true;

    protected $type = [
        'origin_price' => 'float',
        'price'        => 'float',
        'weight'       => 'float',
        'volume'       => 'float'
    ];

    public function goods(): BelongsTo
    {
        return $this->belongsTo(Goods::class, 'goods_id', 'id');
    }
}
